// pages/my/index.js
const App = getApp()

Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: {
      bgUrl: "../../images/bg_card.jpg",
      nickName: "银河便利店",
      number: "YH123456"
    },
  },
  onShow() {
    this.setData({
      isLogin: App.checkIsLogin()
    });
    if (this.data.isLogin) {
      this.getUserDetail();
    }
  },
  getUserDetail(){
    let userInfo=wx.getStorageSync('userInfo')
    this.setData({
      userInfo,
      sexIndex:userInfo.gender==1?0:1
    })
  },

  //领取免费卡
  getFreeCardHandle(){
    wx.navigateTo({
      url:'/pages/memberCard/index'
    })
  }
})